<div class="list-content">
    <div class="title-content">
        <div class="title-name">
            <h2>
                <img src="<?php echo base_url("public/template/frontend/images") ?>/title-pro.png" alt="title">
                THÔNG TIN CÁ NHÂN
            </h2>
            <span>&nbsp;</span>
        </div>                                                      
    </div><!--title-content-->
    <div class="clear-both"></div>
    <div class="main-content">                            
        <form action="" method="post" id="customer" class="normal-form">
            <fieldset>
                <legend>Quản lý thông tin</legend>
                <?php
                if (isset($notice1)) {
                    ?>
                    <p>
                        <label></label><label class="error"><?php echo $notice1; ?></label>
                    </p>
                    <?php
                }
                ?>
                <p>
                    <label>Tên: </label>
                    <input type="text" name="data[name]" value="<?php echo $cus->name; ?>" class="vali"/><?php echo form_error('data[name]'); ?>
                </p>
                <p>
                    <label>Giới tính: </label>
                    <input type="radio" name="data[gender]" value="1" <?php if ($cus->gender == 1) echo "checked"; ?>>Nam
                    <input type="radio" name="data[gender]" value="0" <?php if ($cus->gender == 0) echo "checked"; ?>>Nữ
                    <input type="radio" name="data[gender]" value="2" <?php if ($cus->gender == 2) echo "checked"; ?>>Không xác định
                </p>
                <p>
                    <label>Số điện thoại: </label>
                    <input type="text" name="data[phone]" value="<?php echo $cus->phone; ?>" class="vali"/><?php echo form_error('data[phone]'); ?>
                </p>
                <p>
                    <label>Địa chỉ: </label>
                    <input type="text" name="data[address]" value="<?php echo $cus->address; ?>" class="vali"/><?php echo form_error('data[address]'); ?>
                </p>
                <p>
                    <label></label>
                    <input type="submit" name="info" value="Thay đổi"/>                               
                </p>
            </fieldset>
        </form>
        <div class="clear-both"></div>
        <form action="" method="post" id="change-pass" class="normal-form">
            <fieldset>
                <legend>Đổi mật khẩu</legend>                
                <p>
                    <label>Mật khẩu cũ: </label>
                    <input type="password" name="oldpass" value="" class="vali"/><?php echo form_error('oldpass'); ?>
                </p>    
                <p>
                    <label>Mật khẩu mới: </label>
                    <input type="password" name="data[pass]" id="newpass" value="" class="vali"/><?php echo form_error('data[pass]'); ?>
                </p>
                <p>
                    <label>Nhập lại mật khẩu: </label>
                    <input type="password" name="passconf" value="" class="vali"/><?php echo form_error('passconf'); ?>
                </p>
                <p>
                    <label></label>
                    <input type="submit" name="change-pass" value="Thay đổi"/>                               
                </p>
            </fieldset>
        </form>
        <div class="clear-both"></div>
        <?php
        if (isset($order) && !empty($order)) {
            ?>
            <form action="" method="post" id="change-pass" class="normal-form">
                <fieldset>
                    <legend>Đơn hàng đã đặt</legend>                

                    <table class="order" border="1">
                        <tr>
                            <th>Trạng thái</th>
                            <th>Sản phẩm</th>
                            <th>Thời gian đặt hàng</th>
                            <th>Ngày giao hàng</th>        
                            <th>Tổng tiền</th>
                        </tr>
                        <?php 
                        foreach($order as $order){
                        ?>
                        <tr>
                            <td><?php if ($order->status == 0) echo "Đang xử lý"; else echo "Đã xử lý"; ?></td>
                            <td>
                            <?php
                            $item = $this->morders_detail->getByOrderId($order->id);
                            foreach($item as $item){
                                echo '['.$item->name .'] x '.$item->qty.'<br/>';
                            }
                            ?>
                            </td>
                            <td><?php echo $order->order_time; ?></td>
                            <td><?php echo $order->deli_date; ?></td>                  
                            <td><b><?php echo number_format($order->total); ?> đ</b></td>
                        </tr>
                        <?php
                        }
                        ?>
                    </table>
                </fieldset>
            </form>
            <?php
        }
        ?>
    </div><!--main-content-->                        
</div><!--list-content-->